<template>
	<view class="box bg_f2">
		<view class="bg_fff hidden">
			<view class="top font_23 flex7">符合评价规则，评分超过10个字有概率获得优惠券奖励。</view>
			<view class="title font_33 van-hairline--bottom">服务评价</view>
			<view class="text_wrapper">
				<textarea class="font_27" placeholder="请输入服务的过程和使体验，更受欢迎哦！" placeholder-style="color: #acacac"
					v-model="submit_info.content"></textarea>
			</view>
		</view>
		<view class="btn2" @click="get_sure">提交</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				submit_info: {
					order_id: '',
					content: ''
				}
			}
		},
		onLoad(e) {
			this.submit_info.order_id = e.id;
		},
		methods: {
			get_sure() {
				if (!this.submit_info.content) return getApp().get_msg('请填写评价内容');

				this.$http.post(this.$api.setEvaluateData, this.submit_info).then(res => {
					getApp().get_msg('评价成功');
					getApp().get_back();
					uni.setStorageSync('evaluate', true);
				})
			}
		}
	}
</script>

<style lang="less">
	.top {
		width: 704rpx;
		height: 65rpx;
		color: #FF6A00;
		margin: 12rpx auto 35rpx;
		border-radius: 6rpx;
		background-color: rgba(255, 106, 0, 0.3);
	}

	.title {
		width: 704rpx;
		margin: 0 auto;
		padding: 0 23rpx 38rpx;
		box-sizing: border-box;
	}

	.text_wrapper {
		width: 704rpx;
		margin: 0 auto;
		padding: 15rpx 23rpx;
		box-sizing: border-box;

		textarea {
			width: 100%;
			height: 600rpx;
		}
	}

	.btn2 {
		margin: 63rpx auto;
	}
</style>
